package neu.soft.service;

import neu.soft.entity.*;
import neu.soft.query.BasePageQuery;
import neu.soft.vo.PageBean;

import java.math.BigDecimal;
import java.util.List;

public interface SupplyService {

    //新增购货单
    int addPurchaseOrder(OperationPurchaseOrder purchaseOrder);

    //通过id查找购货单
    OperationPurchaseOrder findById(Integer purchaseOrderId);

    //根据缺货单生成初步购货单
    OperationPurchaseOrder generatePurchaseOrder(String orderId, List<GoodInfo> goodInfoList, Vendor vendor, BigDecimal totalPrice,String type);

    //缺货检查
    boolean checkShortage(List<NormalOrderInfo> normalOrderInfoList, List<Inventory> inventoryList, int alertValue);

    //批量插入商品信息
    void batchInsertGoodInfo(List<GoodInfo> goodInfoList);

    //完善购货单
    OperationPurchaseOrder finishPurchaseOrder(OperationPurchaseOrder operationPurchaseOrder);

    //分页查询购货单
    PageBean<OperationPurchaseOrder> findByPage(BasePageQuery query);

    //计算所需购货的总金额
    BigDecimal getTotalPrice(List<GoodInfo> goodInfoList);

    List<String> getType();
}
